#pragma once

#define ONLY_ONE_INSTANCE(class_name) \
protected: \
	class_name() {} \
	class_name(const class_name&) {} \
public: \
	static class_name* Instance(void) \
	{ \
		static class_name instance; \
		return &instance; \
	}


template<class entity_type>
class State
{
protected:
	float m_fStateEnterTime;

protected:
	State() : m_fStateEnterTime(0.0f) {}
	State(const State&) {}

public:
	virtual ~State(void) { };

	// If the situation has ended, true is returned. 
	// If the situation continues, false is returned.
	virtual bool Enter(entity_type*, float fTime) = 0;

	// If the situation has ended, true is returned. 
	// If the situation continues, false is returned.
	virtual bool Execute(entity_type*, float fTime) = 0;

	// If the situation has ended, true is returned. 
	// If the situation continues, false is returned.
	virtual bool Exit(entity_type*, float fTime) = 0;
};
